import { AdColumn } from '@/components/AdTable';
import { GetTreeNodes } from './materialcategory.api';

export const columns: AdColumn[] = [
  {
    title: '主键',
    dataIndex: 'Id',
    dataType: 'guid',
    width: 300,
    defaultHidden: true,
    filterable: false,
    sorter: true,
    formVisible: true,
    formEditable: false,
    formCustomer: {
      colProps: {
        offset: 2,
        // span: 24,
        xs: 16, // <576px
        sm: 16, // ≥576px
        md: 16, // ≥768px
        lg: 16, // ≥992px
        xl: 16, // ≥1200px
        xxl: 16, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: '物料分类',
    dataIndex: 'ParentId',
    dataType: 'guid',
    width: 150,
    defaultHidden: true,
    formVisible: true,
    formEditable: true,
    required: false,
    filterable: false,
    sorter: false,
    editComponent: 'ApiTreeSelect',
    editComponentProps: {
      api: GetTreeNodes,
      resultField: 'Data',
      labelField: 'Name',
      valueField: 'Id',
      childrenField: 'Children',
      treeNodeFilterProp: 'Name',
      onChange: (e) => {
        console.log('selected:', e);
      },
    },
    formCustomer: {
      colProps: {
        offset: 2,
        // span: 24,
        xs: 16, // <576px
        sm: 16, // ≥576px
        md: 16, // ≥768px
        lg: 16, // ≥992px
        xl: 16, // ≥1200px
        xxl: 16, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: '类别名称',
    dataIndex: 'Name',
    dataType: 'string',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
    formCustomer: {
      colProps: {
        offset: 2,
        // span: 24,
        xs: 16, // <576px
        sm: 16, // ≥576px
        md: 16, // ≥768px
        lg: 16, // ≥992px
        xl: 16, // ≥1200px
        xxl: 16, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: '英文名称',
    dataIndex: 'FrnName',
    dataType: 'string',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: false,
    filterable: false,
    sorter: false,
    formCustomer: {
      colProps: {
        offset: 2,
        // span: 24,
        xs: 16, // <576px
        sm: 16, // ≥576px
        md: 16, // ≥768px
        lg: 16, // ≥992px
        xl: 16, // ≥1200px
        xxl: 16, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: '说明',
    dataIndex: 'Description',
    dataType: 'text',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: false,
    filterable: false,
    sorter: false,
    formCustomer: {
      colProps: {
        offset: 2,
        // span: 24,
        xs: 16, // <576px
        sm: 16, // ≥576px
        md: 16, // ≥768px
        lg: 16, // ≥992px
        xl: 16, // ≥1200px
        xxl: 16, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: '节点树形路径',
    dataIndex: 'TreePathString',
    dataType: 'text',
    width: 0,
    ifShow: false,
    defaultHidden: true,
    filterable: false,
    formVisible: true,
    formEditable: false,
    formCustomer: {
      colProps: {
        offset: 2,
        // span: 24,
        xs: 16, // <576px
        sm: 16, // ≥576px
        md: 16, // ≥768px
        lg: 16, // ≥992px
        xl: 16, // ≥1200px
        xxl: 16, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: '层级',
    dataIndex: 'Level',
    dataType: 'integer',
    width: 50,
    defaultHidden: false,
    filterable: false,
    formVisible: false,
    formEditable: false,
  },
];

export interface InputDto {}

export interface OutputDto {}
